//
//  GWZTCell.m
//  GiftWanted
//
//  Created by lanou on 15/11/11.
//  Copyright © 2015年 陈文杰. All rights reserved.
//

#import "GWZTCell.h"
#import "UIImageView+WebCache.h"

@implementation GWZTCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        _bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, SCREEN_WIDTH-10, 150)];
        _bgImageView.layer.cornerRadius = 10;
        _bgImageView.layer.masksToBounds = YES;
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 40, SCREEN_WIDTH-10, 30)];
        _titleLabel.textColor = [UIColor whiteColor];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.font = [UIFont systemFontOfSize:20];
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(20, 74, SCREEN_WIDTH-50, 1)];
        view.backgroundColor = [UIColor whiteColor];
        _subtitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 80, SCREEN_WIDTH-10, 30)];
        _subtitleLabel.textColor = [UIColor whiteColor];
        _subtitleLabel.textAlignment = NSTextAlignmentCenter;
        _subtitleLabel.font = [UIFont systemFontOfSize:15];
        [_bgImageView addSubview:_titleLabel];
        [_bgImageView addSubview:view];
        [_bgImageView addSubview:_subtitleLabel];
        [self.contentView addSubview:_bgImageView];
    }
    return self;
}

- (void)setConfigureModel:(GWCollectionsModel *)configureModel {
    
    _configureModel = configureModel;
    [_bgImageView sd_setImageWithURL:[NSURL URLWithString:configureModel.cover_image_url]];
    _titleLabel.text = configureModel.title;
    _subtitleLabel.text = configureModel.subtitle;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
